package com.fzhucc.modules.large;
import com.fzhucc.annotation.AnonymousAccess;
import com.fzhucc.annotation.Log;
import com.fzhucc.annotation.rest.AnonymousGetMapping;
import com.fzhucc.modules.large.service.LargeService;
import com.fzhucc.modules.large.service.LargeZqxService;
import com.fzhucc.modules.sciTechnologyDemand.domain.dto.SciTechnologyDemandQueryCriteria;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.data.domain.Pageable;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author yyg
 * @date 2024-01-04
 **/
@RestController
@RequiredArgsConstructor
@Api(tags = "助企行：大屏展示")
@RequestMapping("/api/zqx/large")
public class LargeZqxController {

    private final LargeZqxService largeZqxService;

    @Log("查询关键数据")
    @ApiOperation("查询关键数据")
    @AnonymousGetMapping("/getCriticalData")
    public ResponseEntity<Object> getCriticalData() {
        return new ResponseEntity<>(largeZqxService.getCriticalData(), HttpStatus.OK);
    }


    @Log("查询需求所在地")
    @ApiOperation("查询需求所在地")
    @AnonymousGetMapping("/getDemndsAllAreasCount")
    public ResponseEntity<Object> getDemndsAllAreasCount() {
        return new ResponseEntity<>(largeZqxService.getDemndsAllAreasCount(), HttpStatus.OK);
    }

    @Log("查询劳模所在地")
    @ApiOperation("查询劳模所在地")
    @AnonymousGetMapping("/getModelsAllAreasCount")
    public ResponseEntity<Object> getModelsAllAreasCount() {
        return new ResponseEntity<>(largeZqxService.getModelsAllAreasCount(), HttpStatus.OK);
    }

    @Log("查询企业需求领域饼图")
    @ApiOperation("查询企业需求领域饼图")
    @AnonymousGetMapping("/getDemandsPie")
    public ResponseEntity<Object> getDemandsPie() {
        return new ResponseEntity<>(largeZqxService.getDemandsPie(), HttpStatus.OK);
    }

    @Log("查询劳模工匠领域饼图")
    @ApiOperation("查询劳模工匠领域饼图")
    @AnonymousGetMapping("/getModelsPie")
    public ResponseEntity<Object> getModelsPie() {
        return new ResponseEntity<>(largeZqxService.getModelsPie(), HttpStatus.OK);
    }

    @Log("查询企业需求需求类别")
    @ApiOperation("查询企业需求需求类别")
    @AnonymousGetMapping("/getDemndsAllTypes")
    public ResponseEntity<Object> getDemndsAllTypes() {
        return new ResponseEntity<>(largeZqxService.getDemndsAllTypes(), HttpStatus.OK);
    }

    @Log("查询劳模人才服务能力")
    @ApiOperation("查询劳模人才服务能力")
    @AnonymousGetMapping("/getModelsAllTypes")
    public ResponseEntity<Object> getModelsAllTypes() {
        return new ResponseEntity<>(largeZqxService.getModelsAllTypes(), HttpStatus.OK);
    }

    @GetMapping(value = "/getDemandsDostatusCounts")
    @Log("需求获取分类数据")
    @ApiOperation("需求获取分类数据")
    @AnonymousAccess
    public ResponseEntity<Object> getDemandsDostatusCounts() {
        return new ResponseEntity<>(largeZqxService.getDemandsDostatusCounts(), HttpStatus.OK);
    }

    @GetMapping(value = "/getDemandsDostatusTop")
    @Log("需求获取分类数据top4 传1全部 2匹配中 3已匹配 4已解决")
    @ApiOperation("需求获取分类数据top4 传1全部 2匹配中 3已匹配 4已解决")
    @AnonymousAccess
    public ResponseEntity<Object> getDemandsDostatusTop(@RequestParam Integer type) {
        return new ResponseEntity<>(largeZqxService.getDemandsDostatusTop(type), HttpStatus.OK);
    }


}